package com.example.icedcap.topeka_fake.model.quiz;

import android.os.Parcel;

import com.example.icedcap.topeka_fake.helper.ParcelableHelper;

/**
 * Author: doushuqi
 * Date: 15/7/15
 * Time: 上午11:30
 * Email: shuqi.dou@singuloid.com
 */
public final class TrueFalseQuiz extends Quiz<Boolean> {
    public TrueFalseQuiz(String question, Boolean answer, boolean solved) {
        super(question, answer, solved);
    }

    protected TrueFalseQuiz(Parcel in) {
        super(in);
        setAnswer(ParcelableHelper.readBoolean(in));
    }

    @Override
    public QuizType getQuizType() {
        return QuizType.TRUE_FALSE;
    }

    @Override
    public String getStringAnswer() {
        return getAnswer().toString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        ParcelableHelper.writeBoolean(dest, getAnswer());
    }
}
